import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginGuard } from '@guard/loginGuard';

import { MyaccountPage } from './myaccount.page';
import { MyaccountResolver } from './myaccount-resolver.service';

const routes: Routes = [
  {
    path: '',
    component: MyaccountPage,
    resolve: {
      data:MyaccountResolver
    }
  },
  {
    path: 'statement',
    loadChildren: () => import('./statement/statement.module').then( m => m.StatementPageModule)
  },
  {
    path: 'repayment',
    loadChildren: () => import('./repayment/repayment.module').then( m => m.RepaymentPageModule)
  },
  {
    path: 'installment',
    loadChildren: () => import('./installment/installment.module').then( m => m.InstallmentPageModule)
  },
  {
    path: 'bank-account',
    loadChildren: () => import('./bank-account/bank-account.module').then( m => m.BankAccountPageModule)
  },
  {
    path: 'setting',
    loadChildren: () => import('./setting/setting.module').then( m => m.SettingPageModule),
    canActivate:[LoginGuard]
  },
  {
    path: 'comm-agreement',
    loadChildren: () => import('./comm-agreement/comm-agreement.module').then( m => m.CommAgreementPageModule)
  }


];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
  providers: [
    MyaccountResolver
  ]
})
export class MyaccountPageRoutingModule {}
